package com.up.vms.infrastructure.enums;

/**
 * 系统级别的错误码, 不允许任何人随便添加, 如果需要, 加在BizRespCode 中
 *
 * @author Andy
 * @since 2017-11-27 11:17
 */
public enum GeneralRespCode {


    SUCCESS("EDI-10000", "成功"),

    SERVICE_FAILED("EDI-20000", "平台服务异常"),
    SERVICE_UNAVAILABLE("EDI-20001", "平台服务暂停"),
    API_NOT_FOUND("EDI-20002", "请求的接口不存在，请核对接口URL地址"),
    IP_NOT_BOUND("EDI-20003", "接入方网络地址绑定校验失败"),
    TOKEN_NOT_VALID("EDI-20004", "接入方Token校验失败"),
    API_FORBIDDEN("EDI-20005", "接入方访问的接口未经授权"),
    ACCESS_OVER_FREQUENCY("EDI-20006", "接入方访问过于频繁"),
    PROCESSING_TIMEOUT("EDI-20007", "服务处理超时"),
    FORMAT_PARSE_FAILED("EDI-20010", "请求消息无法解析或格式错误"),
    BAD_PARAMETERS("EDI-20011", "请求参数不合法"),
    MISS_PARAMETERS("EDI-20012", "请求消息缺少必输项"),
    DATA_DECRYPT_FAILED("EDI-20013", "加密数据无法正常解密"),
    REQUEST_UNAUTHORIZED("EDI-20014", "请求数据未经授权"),
    UNSUPPORT_CHANNEL("EDI-20015", "暂不支持的渠道"),

    RANDOM_CODE_CREATE_FAILED("EDI-21001", "创建随机码失败"),
    RANDOM_CODE_SEND_FAILED("EDI-21002", "发送随机码失败"),
    VERIFICATION_CODE_NOT_EXIST("EDI-21003", "验证码不存在"),
    VERIFICATION_CODE_INVALID("EDI-21004", "验证码失效"),
    VERIFY_CODE_FAILED("EDI-21005", "验证不通过验证码无效"),

    SMS_SEND_OVER_TIMES("EDI-21010", "短信验证码请求次数超限"),

    SERVICE_ERROR("EDI-22000", "服务处理失败"),

    REMOTE_AUTH_FAILED("EDI-30000", "TOKEN认证失败"),
    REMOTE_SERVICE_FAILED("EDI-30001", "远程服务响应异常"),
    REMOTE_SERVICE_INFO_ERROR("EDI-30002", "远程服务返回信息有误，没有查询到结果"),

    VERIFY_PAY_PASSWORD_FAILED("EDI-30011", "支付密码错误"),

    SYSTEM_LOGIN_NEED("EDI-30042", "用户未登录"),
    SYSTEM_LOGIN_FAILED("EDI-30040", "用户名或密码错误"),
    SYSTEM_LOGIN_NULL("EDI-30041", "用户名或密码为空"),
    SYSTEM_LOGIN_TIMEOUT("EDI-30041", "用户登录超时");

    public final String code;
    public final String desc;

    GeneralRespCode(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static GeneralRespCode of(String value) {
        if (value == null) {
            return null;
        }
        GeneralRespCode[] var1 = values();
        int var2 = var1.length;
        for (int var3 = 0; var3 < var2; ++var3) {
            GeneralRespCode a = var1[var3];
            if (a.code.equals(value)) {
                return a;
            }
        }
        return null;
    }

}
